package 设计模式.thery;

public class Client {
    public static void main(String[] args) {
        Originator originator=new Originator();
        Caretaker caretaker=new Caretaker();

        originator.setState("攻击力100");
        caretaker.add(originator.saveMemento());
        System.out.println(originator.getState());

        originator.setState("攻击力80");
        caretaker.add(originator.saveMemento());
        System.out.println(originator.getState());
        System.out.println("=========恢复=========");

        originator.getMemento(caretaker.get(0));
        System.out.println(originator.getState());
    }
}
